//
//  ZSMAFNetWork.h
//  FoodAndDrinkAndHealthy
//
//  Created by dlios on 15-9-1.
//  Copyright (c) 2015年 zhoushengmin. All rights reserved.
//
#import <Foundation/Foundation.h>

typedef enum : NSUInteger {
    ZSMData,
    ZSMJSON,
    ZSMXML,
} ZSMResult;

typedef enum : NSUInteger {
    ZSMRequestJSON,
    ZSMRequestString,
} ZSMRequestStyle;



@interface ZSMAFNetWork : NSObject

/**
 *  Get请求
 *
 *  @param url        网络请求地址
 *  @param body       请求体
 *  @param result     返回的数据类型
 *  @param headerFile 请求头
 *  @param success    网络请求成功回调
 *  @param failure    网络请求失败回调
 */

+(void)geturl:(NSString *)url
         body:(id)body
       result:(ZSMResult)result
   headerFile:(NSDictionary *)headerFile
      success:(void(^)(id result))success
      failure:(void(^)(NSError *error))failure;


/**
 *  Post请求
 *
 *  @param url          网络请求地址
 *  @param body         请求体
 *  @param result       返回值的数据类型
 *  @param requestStyle 网络请求body的类型
 *  @param headerFile   网络请求头
 *  @param success      成功回调
 *  @param failure      失败回调
 */
+ (void)posturl:(NSString *)url
          body:(id)body
        result:(ZSMResult)result
  requestStyle:(ZSMRequestStyle)requestStyle
    headerFile:(NSDictionary *)headerFile
       success:(void(^)(id result))success
       failure:(void(^)(NSError *error))failure;


+ (void)SeekPosturl:(NSString *)url
          body:(id)body
        result:(ZSMResult)result
  requestStyle:(ZSMRequestStyle)requestStyle
    headerFile:(NSDictionary *)headerFile
       success:(void(^)(id result))success
       failure:(void(^)(NSError *error))failure ;








@end
